package com.kay.car.dao;

import com.kay.car.entity.CarTable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CarDao extends JpaRepository<CarTable,Long> {
    public CarTable findOneByTitle(String title);

    List<CarTable> findAllByYearAndKeywordLike(String year, String key);

    CarTable findOneById(Long id);

    List<CarTable> findAllByKeywordLike(Sort sort, String s);

    List<CarTable> findAllByEnable(boolean b);

    List<CarTable> findAllByKeywordLikeAndEnable(String s, boolean b);

    List<CarTable> findAllByDog(int i);

    List<CarTable> findAllByKeywordLikeAndDog(String s, int i);
}
